<template>
  <v-chart
    class="chart"
    :option="{
      title: { text: '各题错误数量' },
      tooltip: {},
      xAxis: { data: names },
      yAxis: {},
      series: [{name: '题号', type: 'bar', data }],
    }"
  />
</template>

<script>
import { use } from "echarts/core";
import { CanvasRenderer } from "echarts/renderers";
import { PieChart, BarChart } from "echarts/charts";
import {
  TooltipComponent,
  GridComponent,
  TitleComponent,
} from "echarts/components";
import VChart from "vue-echarts";

use([
  CanvasRenderer,
  PieChart,
  TooltipComponent,
  GridComponent,
  BarChart,
  TitleComponent,
]);

export default {
  name: "Cycle",
  props: ["o"],
  components: {
    VChart,
  },
  props: ['names', 'data']
};
</script>

<style scoped>
.chart {
  height: 300px;
}
</style>

<style>
body {
  margin: 0;
}
</style>
